<template>
  <div>
    <template v-if="stockList.length === 0">
      {{ stockNum }}
    </template>
    <template v-else>
      <el-tooltip effect="dark" placement="right">
        <template #content>
          <div
            v-for="(stockItem,index) in stockList"
            :key="index"
          >
            <template v-if="stockItem.type === 'box'">
              {{ $t('table.num/箱',{num: stockItem.goodsNumInBox}) }}
            </template>
            <template v-else>
              {{ $t('table.混装/个') }}
            </template>
            :
            {{stockItem.num}}
          </div>
        </template>
        <div>
          {{ stockNum }}
        </div>

      </el-tooltip>

    </template>

  </div>
</template>

<script>
export default {
  name: 'StockNum',
  props: {
    stockList: {
      type: Array,
      required: true,
    },
    stockNum: {
      type: Number,
      required: true,
    }
  }
}
</script>


<style scoped lang="scss">

</style>
